<template>
  <div id="share">
    <div class="bdsharebuttonbox bdshare-button-style0-16">
      <a href="#" class="bds_qzone" data-cmd="qzone" title="分享到QQ空间"></a>
      <a href="#" class="bds_tsina" data-cmd="tsina" title="分享到新浪微博"></a>
      <a href="#" class="bds_weixin" data-cmd="weixin" title="分享到微信"></a>
      <a href="#" class="bds_sqq" data-cmd="sqq" title="分享到QQ好友"></a>
      <a href="#" class="bds_twi" data-cmd="twi" title="分享到Twitter"></a>
    </div>
  </div>
</template>

<script>
export default {
  beforeCreate () {
    const _this = this
    window._bd_share_main = ''   // 解决页面加载不生效的问题
    setTimeout(() => {
      _this.setup()
    }, 0)
  },
  methods: {
    setup () {
      window._bd_share_config = {
        'common': {
          'bdSnsKey': {},
          'bdText': '',
          'bdMini': '1',
          'bdMiniList': ['qzone', 'tsina', 'weixin', 'sqq', 'twi'],
          'bdPic': '',
          'bdStyle': '2',
          'bdSize': '24'
        },
        'share': {}
      }
      const s = document.createElement('script')
      s.type = 'text/javascript'
      s.src = '/statics/api/js/share.js?v=89860593.js?cdnversion=' + ~(-new Date() / 36e5)
      document.body.appendChild(s)
    }
  }
}
</script>
